<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/9/23/023
  Time: 15:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%--<script type="text/javascript" src="/script/jquery-1.7.2.js"></script>--%>
    <%--<script type="text/javascript">--%>
        <%--$(function () {--%>
            <%--$(".delete").click(function () {--%>
                <%--var href=$(this).attr("href");--%>
                <%--$("form").attr("action",href).submit();--%>
                <%--return false;--%>
            <%--})--%>
        <%--})--%>
    <%--</script>--%>
</head>
<body>
    <center>
        <form action="" method="post">
            <input type="hidden" name="_method" value="DELETE">
        </form>
        <c:if test="${empty requestScope.employee}" >
            员工信息为空；
        </c:if><br>
        <c:if test="${!empty requestScope.employee}">
            <table border="1" cellpadding="10" cellspacing="0">
                <tr>
                    <th>ID</th>
                    <th>lastName</th>
                    <th>email</th>
                    <th>Gender</th>
                    <th>Department</th>
                    <th>Edit</th>
                    <th>delete</th>
                </tr>
                <c:forEach items="${requestScope.employee}" var="employeey">
                    <tr>
                        <th>${employeey.id}</th>
                        <th>${employeey.lastName}</th>
                        <th>${employeey.email}</th>
                        <th>${employeey.gender==0? 'female':'male'}</th>
                        <th>${employeey.department.departmentName}</th>
                        <th><a href="update/${employeey.id}">Edit </a></th>
                        <th><a href="delete/${employeey.id}">delete</a></th>
                    </tr>
                </c:forEach>
            </table>
        </c:if>
        <a href="emp"> add new employee</a>
    </center>
</body>
</html>
